<template>
	<view>
		<!-- :style="{height: 100 + 'vh'}"100vh不起到作用 -->
		<!-- 投稿悬浮窗 S-->
		<view v-if="number==0" class="nanbar-box " style="text-align: center;" @click="pageJumps('/pagesSecond/strategy/writeTxt')">
			<view class="center_combo">
				<image class="tp-img36" style="margin: 15rpx 0 0 0;" src="../../static/imgs/icons/edit-icon.png" mode=""></image>
			</view>
			<text class=" tp-fcF" style="font-size: 20rpx;margin: 0;">发布文章</text>
		</view>
		<!-- 悬浮窗 E-->
		<view class="tp-pr" style="background:#00B4FF;z-index:9999;position: fixed;top: 0;width: 100%;" :style="{height:statusBarHeight + 'px'}"></view>
		<!-- 顶部搜索 S-->
		<!-- #ifdef MP-WEIXIN -->
		<view class="top-box" :style="{top:topheight  + 'rpx'}">
			<!-- #endif -->
			<!-- #ifdef H5 -->
			<view class="top-box" :style="{top:topheight  + 'rpx'}">
				<!-- #endif -->
				<view class="topname tp-pr" style="background:#00B4FF;">
					<view class="">
						<text class="topnametit" v-if="number==0">旅游攻略</text>
						<text class="topnametit1" v-if="number==1" @click="numType">旅游攻略</text>
						<view class="topbottom" v-if="number==0"></view>
					</view>
					<view>
						<text class="topnametit" v-if="number1==1">活动投稿</text>
						<text class="topnametit1" v-if="number1==0" @click="numType1">活动投稿</text>
						<view class="topbottom1" v-if="number1==1">
						</view>
					</view>
				</view>

			</view>
			<!-- #ifdef MP-WEIXIN -->
			<view class="top-box" :style="{top:topheight  + 98 + 'rpx'}" style="z-index: 10;">
				<!-- #endif -->
				<!-- #ifdef H5 -->
				<view class="top-box" :style="{top:topheight  + 98 + 'rpx'}" style="z-index: 10;">
					<!-- #endif -->

					<view class="searchbox tp-h88 level_align " v-if="number1==0">
						<view class="search">
							<uni-search-bar radius="100" placeholder="请输入关键字" @cancel="search" @clear="search" @confirm="search" />
						</view>
					</view>
				</view>
				<!-- 顶部搜索 E-->
				<!--旅游攻略筛选S-->
				<view :style="{top:topheight  + 186 + 'rpx'}" style="position: fixed;z-index: 10;" class="shaixuan-box tp-h88 tp-bgf level_align tp-bbox flex_between tp-fc333 tp-fz28 tp-ptb0lr30 tp-pr"
				 v-if="number==0 && isCheck">
					<view class="level_align tp-h100" @click="showChange(1)" :style="{color: showIndex == 1 ? '#00B4FF': ''}">
						<text class="tp-mr15">游记</text>
					</view>
					<view class="level_align tp-h100" @click="showChange(2)" :style="{color: showIndex == 2 ? '#00B4FF': ''}">
						<text class="tp-mr15">摄影</text>
					</view>
					<view  class="level_align tp-h100" @click="showChange(3)" :style="{color: showIndex == 3 ? '#00B4FF': ''}">
						<text class="tp-mr15">短视频</text>
					</view>

					<view class="level_align tp-h100" @click="show" :style="{color: showIndex == 4 ? '#00B4FF': ''}">
						<text class="tp-mr15">筛选</text>
						<image src="../../static/imgs/icons/shaixuan.png" class="tp-img36" mode=""></image>

					</view>
				</view>
				<!--旅游攻略筛选E-->
				<!-- 旅游攻略列表 S-->
				<!-- #ifdef MP-WEIXIN -->
				<view class="listone" v-if="number==0" :style="{marginTop:topheight + 294  + 'rpx'}">
					<!-- #endif -->
					<!-- #ifdef H5 -->
					<view class="listone" v-if="number==0" :style="{marginTop:294  + 'rpx'}">
						<!-- #endif -->
						<view class="yw" @click="seemessage(item)" v-for="item in lygllist" :key='item.id'>
							<view class="ywleft">
								<image class="ywimg" style="border-radius: 12rpx;" :src="wwwImgUrl + item.cover" mode="aspectFill"></image>
							</view>
							<view class="ywright">
								<view class="ywtx">
									<image class="ywperson" :src="item.customerAvater" mode="aspectFill"></image>
									<view class="ywname">
										<text>{{item.customerName}}</text>
									</view>
									<view class="ywtittime">
										<text>{{item.createTime}}</text>
									</view>
								</view>
								<view class="ywtit ">
									<text class="ellispsis1 ywtitneirong">{{item.articleName}}</text>
								</view>
								<view class="ywbiaoqian">
									<view class="biaoqiantit ellispsis1">
										<text v-for="items in item.label" :key="items.id">{{'#' + items}}</text>
									</view>
									<view class="ywsee ">
										<image class="ywseeimg" src="../../static/imgs/icons/see.png" mode=""></image>
										<text class="ywseenum">{{item.readNum}}</text>
									</view>
								</view>
							</view>
						</view>
					</view>
					<!-- 旅游攻略列表 E-->
					<!-- 暂无数据 S -->
					<view v-if="lygllist.length == 0">
						<view class="tp-h98 tp-w100"></view>
						<text class="tp-h98 center_combo">暂无数据</text>
						<view class="tp-h98 tp-w100"></view>
					</view>
					<!-- 暂无数据 E -->


					<!--活动投稿筛选S-->
					<!-- #ifdef MP-WEIXIN -->
					<view :style="{top:topheight + 98 + 'rpx'}" style="position: fixed;z-index: 1000;" class="shaixuan-box tp-h90 tp-bgf level_align tp-bbox flex_between tp-fc333 tp-fz28 tp-ptb0lr30 tp-pr "
					 v-if="number1==1">
						<!-- #endif -->
						<!-- #ifdef H5 -->
						<view :style="{top:98  + 'rpx'}" style="position: fixed;z-index:1000;" class="shaixuan-box tp-h90 tp-bgf level_align tp-bbox flex_between tp-fc333 tp-fz28 tp-ptb0lr30 tp-pr "
						 v-if="number1==1">
							<!-- #endif -->
							<view class="level_align tp-h100" @click="showChange4(4)" :style="{color: showIndex == 4 ? '#00B4FF': ''}">
								<text class="tp-mr15" style="margin-left:40rpx">排序</text>
								<image v-show="showIndex != 4" class="sanjiao" src="../../static/imgs/icons/sanjiao.png" mode=""></image>
								<image v-show="showIndex == 4" class="sanjiao" src="../../static/imgs/icons/sanjiao-lan.png" mode=""></image>
							</view>
							<view class="level_align tp-h100" @click="tougaoshow" :style="{color: showIndex == 5 ? '#00B4FF': ''}">
								<text class="tp-mr15">筛选</text>
								<image class="tp-img36" src="../../static/imgs/icons/shaixuan.png" mode=""></image>
							</view>
							<image @click="isHang = !isHang" v-if="isHang" class="tp-img36" src="../../static/imgs/icons/kuai.png" mode=""></image>
							<image @click="isHang = !isHang" v-if="!isHang" class="tp-img36" src="../../static/imgs/icons/heng.png" mode=""></image>
						</view>
						<!--活动投稿筛选E-->
						<!-- 列表 S -->
						<!-- #ifdef MP-WEIXIN -->
						<view class="list-box " v-if="number1==1" :style="{marginTop:topheight + 206  + 'rpx'}">
							<!-- #endif -->
							<!-- #ifdef H5 -->
							<view class="list-box " v-if="number1==1" :style="{marginTop:206  + 'rpx'}">
								<!-- #endif -->
								<!-- 行展示 S -->

								<view v-if="isHang" class="list-hang tp-ptb0lr30  level_align tp-bgf" @click="pageJumps('/pagesSecond/strategy/strategyHuodong' + '?id=' + item.id)"
								 v-for="(item,index) in activityList" :key="index">
									<view class="">
										<!-- 活动状态 S-->
										<view class="hdtype" v-if="item.statusDesc == '进行中'">
											{{item.statusDesc || ''}}
										</view>
										<!-- 活动状态 E-->
										<!-- 活动状态 S-->
										<view class="overhdtype" v-if="item.statusDesc == '已完成'">
											{{item.statusDesc || ''}}
										</view>
										<!-- 活动状态 E-->
										<image class="hang-img tp-mr20" style="border-radius: 12rpx;" :src="wwwImgUrl + item.activityCover" mode="aspectFill"></image>

									</view>
									<view class="hang-right flex flex_column flex-1">
										<view class="tgaddress tp-fz24 tp-fc333 ellispsis2">
											{{item.activityTitle || ''}}
										</view>
										<view class="level_align flex flex_between">
											<view class="">
												<text class="huang-color">{{item.timeDesc || ''}}</text>
											</view>
											<view class="">
												<image class="posimg tp-mr10" src="../../static/imgs/icons/see.png" mode=""></image>
												<text class="tp-fc999">{{item.readnum || ''}}</text>
											</view>
										</view>
									</view>
								</view>
								<!-- 行展示 E -->

								<!-- 块展示 S-->
								<!-- #ifdef MP-WEIXIN -->
								<view v-if="!isHang" :style="{marginTop:topheight + 206  + 'rpx'}" class=" tp-ptb0lr30  level_align flex_wrap"
								 style="background: #FFFFFF;">
									<!-- #endif -->
									<!-- #ifdef H5 -->
									<view v-if="!isHang" :style="{marginTop:206  + 'rpx'}" class=" tp-ptb0lr30  level_align flex_wrap" style="background: #FFFFFF;">
										<!-- #endif -->
										<view class="list-kuai " v-for="(item,index) in activityList" :key="index" @click="pageJumps('/pagesSecond/strategy/strategyHuodong' + '?id=' + item.id)">
											<!-- 活动状态 S-->
											<view class="hdtype1" v-if="item.statusDesc == '进行中'">
												<text>{{item.statusDesc || ''}}</text>
											</view>
											<!-- 活动状态 E-->
											<!-- 活动状态 S-->
											<view class="overhdtype1" v-if="item.statusDesc == '已完成'">
												<text>{{item.statusDesc || ''}}</text>
											</view>
											<!-- 活动状态 E-->
											<image class="kuai-img" style="border-radius: 12rpx;" :src="wwwImgUrl + item.activityCover" mode="aspectFill"></image>
											<view class="flex flex_column  tp-pb20">
												<view class="tp-lh24 tp-fc333 tp-fz24" style="margin-top: 20rpx;height: 64rpx;">
													<text class="ellispsis2">{{item.activityTitle || ''}}</text>
												</view>
												<view class="level_align flex flex_between tp-mt20">
													<view class="">
														<text class="huang-color">{{item.timeDesc || ''}}</text>

													</view>
													<view class="">
														<image class="posimg1 tp-mr10" src="../../static/imgs/icons/see.png" mode=""></image>
														<text class="tp-fc999">{{item.readnum || ''}}</text>
													</view>
												</view>
											</view>
										</view>

									</view>
									<!-- 块展示 E -->
								</view>
								<!-- 列表 E -->
								<!-- 排序弹框 S-->

								<uni-popup ref="popup" type="top">
									<!-- #ifdef MP-WEIXIN -->
									<view class="tp-bgf " :style="{marginTop:topheight + 188 + 'rpx'}">
										<!-- #endif -->
										<!-- #ifdef H5 -->
										<view class="tp-bgf " :style="{marginTop:188  + 'rpx'}">
											<!-- #endif -->
											<view class="tp-ptb0lr30 tp-bgf">
												<view @click="flactive.index = index,flactive.name = item,myId(item)" class="leibie tp-h98 flex_between level_align tp-bgf tp-ptb0lr30 tp-bdbm tp-fc333 tp-fz30"
												 v-for="(item,index) in fltextType " :key="index">
													<text class="tp-fz30 tp-fc333">{{item.name}}</text>
													<uni-icons v-if="flactive.index == index" type="checkmarkempty" size="40" color="#00B4FF"></uni-icons>
													<!-- <image  class="tp-img32" src="/static/icon/select.png" mode=""></image> -->
												</view>
											</view>
											<view class="area-bottom center_combo">
												<view @click="filtratePopupClose" class="btn tp-mr30 tp-bcF5 tp-fc999 center_combo">
													取消
												</view>
												<view @click="areaSearch" class="btn tp-bc tp-fcF center_combo">
													确定
												</view>
											</view>
										</view>
								</uni-popup>
								<!-- 排序弹框 E-->
								<!-- 活动投稿筛选抽屉 S-->
								<uni-drawer ref="tgdraw" :mask="mask" :width="drawWid" :mode='mode' :maskClick='false'>
									<!-- #ifdef MP-WEIXIN -->
									<view class="tp-pr" style="padding:30rpx;z-index:99;position: fixed;width: 90%;" :style="{paddingTop:topheight + 188 + 'rpx'}">
										<!-- #endif -->
										<!-- #ifdef H5 -->
										<view style="padding:30rpx;padding-top: 190rpx;">
											<!-- #endif -->
											<view class="uni-title tp-pr">
												<view class="shaixuan">
													<view class="lblist">
														<view class="leibie">
															<text class="leibietit">类别</text>
														</view>
														<view class="lbbiaoqian">
															<view class="lbbiaoqianlist" :class="{'active':activityspanIndex.indexOf(index)>-1}" @click="actchangeValue(item,index)"
															 v-for="(item,index) in activitylblist" :key='index'>
																<text class="lbtit">{{item.value}}</text>
															</view>
														</view>
													</view>
													<view class="lblist1">
														<view class="leibie">
															<text class="leibietit">分类</text>
														</view>
														<view class="lbbiaoqian">
															<view class="lbbiaoqianlist" :class="{'active':activityflspanIndex.indexOf(index)>-1}" @click="actchangeValue1(item,index)"
															 v-for="(item,index) in activityfllist" :key='index'>
																<text class="lbtit">{{item.value}}</text>
															</view>
														</view>
													</view>

													<view class="leibie">
														<text class="leibietit">景点名称</text>
													</view>
													<scroll-view scroll-y="true" class="" style="height: 300rpx;" @scrolltolower="handleScrolltolower">
														<view class="lbbiaoqian">
															<view class="lbbiaoqianlist" :class="{'active':activityjdspanIndex.indexOf(index)>-1}" @click="actchangeValue2(item,index)"
															 v-for="(item,index) in jdlist" :key='index'>
																<text class="lbtit">{{item.label}}</text>
															</view>
														</view>
													</scroll-view>
													<view class="quxiao" @tap="hide()">
														<text>取消</text>
													</view>
													<view class="queding" @tap="queding1()">
														<text>确定</text>
													</view>
												</view>
											</view>
										</view>
										<!-- <button type="warn" @tap="hide()" style="margin-top: 100rpx;">关闭</button> -->
								</uni-drawer>
								<!-- 活动投稿筛选抽屉 E-->
								<!-- 旅游攻略筛选抽屉  S-->
								<uni-drawer ref="draw" :mask="mask" :width="drawWid" :mode='mode' :maskClick='false'>
									<!-- #ifdef MP-WEIXIN -->
									<view class="tp-pr" style="padding:30rpx;z-index:99;position: fixed;" :style="{paddingTop:topheight + 98 + 'rpx'}">
										<!-- #endif -->
										<!-- #ifdef H5 -->
										<view style="padding:30rpx;padding-top: 100rpx;">
											<!-- #endif -->

											<view class="uni-title tp-pr">
												<view class="shaixuan">
													<view class="lblist">
														<view class="leibie">
															<text class="leibietit">类别</text>
														</view>
														<view class="lbbiaoqian">
															<view class="lbbiaoqianlist" :class="{'active':spanIndex.indexOf(index)>-1}" @click="changeValue(item,index)"
															 v-for="(item,index) in lblist" :key='index'>
																<text class="lbtit">{{item.value}}</text>
															</view>
														</view>
													</view>

													<view class="leibie">
														<text class="leibietit">时间范围</text>
													</view>

													<view class="area-bottom1 center_combo">
														<view class="btn tp-mr30 tp-bcF5 tp-fc999 center_combo">
															<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange">
																<view class="">{{date}}</view>
															</picker>
														</view>
														<view class="btn tp-mr30 tp-bcF5 tp-fc999 center_combo">
															<picker mode="date" :value="date1" :start="startDate" :end="endDate" @change="bindDateChange1">
																<view class="">{{date1}}</view>
															</picker>
														</view>
													</view>

													<view class="leibie">
														<text class="leibietit">景点名称</text>
													</view>
													<scroll-view scroll-y="true" class="" style="height: 300rpx;" @scrolltolower="handleScrolltolower">
														<view class="lbbiaoqian">
															<view class="lbbiaoqianlist" :class="{'active':jingdianIndex.indexOf(index)>-1}" @click="changeValue2(item,index)"
															 v-for="(item,index) in jdlist" :key='index'>
																<text class="lbtit">{{item.label}}</text>
															</view>
														</view>
													</scroll-view>
													<view class="quxiao1" @tap="hide()">
														<text>取消</text>
													</view>
													<view class="queding1" @tap="queding()">
														<text>确定</text>
													</view>

												</view>
											</view>
										</view>
										<!-- <button type="warn" @tap="hide()" style="margin-top: 100rpx;">关闭</button> -->
								</uni-drawer>
								<!-- 旅游攻略筛选抽屉  E-->
							</view>
</template>

<script>
	import uniDrawer from "@/components/uni-drawer/uni-drawer";
	import calendar from '@/components/tp-calendar/util.js'
	//获取系统状态栏高度
	var statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
	export default {
		components: {
			uniDrawer
		},
		data() {
			let day2 = new Date();
			day2.setTime(day2.getTime());
			let s2 = day2.getFullYear() + "-" + (day2.getMonth() + 1) + "-" + day2.getDate();
			const currentDate = this.getDate({
				format: true
			})
			const currentDate1 = this.getDate1({
				format: true
			})
			return {
				showMsk: true, //不允许滑动
				endDate: s2, //可选时间的范围
				startDate: '2020-01-01', //可选时间的范围
				date: '2020-01-01' || currentDate, //选中的开始时间
				date1: currentDate1, //选中的结束时间
				spanIndex: [], //旅游类别多选数组
				jingdianIndex: [], //旅游景点多选数组
				activityspanIndex: [], //活动的类别多选数组
				activityflspanIndex: [], //活动的分类多选数组
				activityjdspanIndex: [], //活动的景点多选数组
				isHang: false, // 行排列true 还是 块false
				statusBarHeight: statusBarHeight, //高度
				mask: true, //抽屉
				left: 'left', //抽屉
				drawWid: 300, //抽屉宽度
				maskClick: true, //抽屉
				mode: 'right', //抽屉
				shaixuan: false,
				isActive: false, //标签的点击状态
				isActive1: false, //标签的点击状态
				isActive2: false, //标签的点击状态
				number: 0, //顶部状态
				number1: 0, //顶部状态
				showIndex: 1, //默认选择的文章类型下标
				showlylb: 1,
				lygllist: [], //旅游攻略列表
				lblist: [], //旅游攻略类别list
				jdlist: [], //景点列表,名称
				lylbid: [], //选中的旅游攻略类别id的中间量
				newlylbid: '', //转字符串的选中的旅游攻略类别id
				jingdianid: [], //选中的旅游攻略景点id的中间量
				newjingdianid: '', //转字符串的选中的旅游攻略景点id

				actlylbid: [], //选中的旅游攻略类别id的中间量
				actnewlylbid: '', //转字符串的选中的旅游攻略类别id
				actflid: [], //选中的旅游攻略类别id的中间量
				actnewflid: '', //选中的旅游攻略类别id的中间量
				actjingdianid: [], //选中的旅游攻略景点id的中间量
				actnewjingdianid: '', //转字符串的选中的活动景点id
				//活动投稿的列表项
				activityList: [], //活动投稿列表
				activitylblist: [], //活动投稿类别列表
				activityfllist: [], //活动投稿分类列表
				fltextType: [{
					name: '默认',
					id: ''
				}, {
					name: '时间从近到远',
					id: 1
				}, {
					name: '阅读量从高到低',
					id: 2
				}], //排序弹窗的内容
				myid: '', //选中的排序id
				flactive: {
					index: 0,
					name: '',
				},
				fllist: [],
				topheight: '', //顶部高度转换rpx
				pageNum: 1, // 当前页码,请设置初始值
				pageSize: 10, // 每页显示数量,请设置初始值
				last_page: null, // 总页数
				scpageNum: 1, // 景区名称的当前页码,请设置初始值
				scpageSize: 20, // 景区名称的每页显示数量,请设置初始值
				sclast_page: null, // 景区名称的总页数
				list: [],
				loadMoreText: "加载中...",
				showLoadMore: false, // 加载更多
				searchVal: '', //搜索
				nowCity: '', //跳转来的当前城市   //默认不传
				jqId: '', // 景区详情过来的景区id
				isCheck: false, // true正常显示 false隐藏
			};
		},
		onLoad(opt) {
			this.searchVal = opt.searchVal && opt.searchVal
			//顶部高度转换rpx
			this.topheight = statusBarHeight * 2 - 8
			// 各种下拉选项设置300:文章分类 301:活动攻略类别 302: 活动分类
			for (let i = 300; i < 303; i++) {
				this.getDictData(i)
			}
			// this.getjqNameandlist()
			this.pageNum = 1
			this.last_page = null
			this.getjqNameandlist()
			this.getlist()
			this.getBanBen()
		},
		onShow() {
			console.log('onshow')
			if (uni.getStorageSync('jqId')) {
				this.jqId = uni.getStorageSync('jqId');
				this.newjingdianid = this.jqId
				
				this.getlist()
			}
		},
		// 下拉刷新
		onPullDownRefresh() {
			console.log('onPullDownRefresh');
			this.pageNum = 1
			this.list = []
			this.loadMoreText = "加载中..."
			if (this.number == 0) {
				this.getlist()
			}
			if (this.number == 1) {
				this.getactivityList()
			}
		},
		// 上拉触底
		onReachBottom() {
			console.log(this.pageNum)
			console.log(this.last_page)
			if (this.pageNum < this.last_page) {
				this.showLoadMore = true;
				this.pageNum++
				if (this.number == 0) {
					this.getlist()
				}
				if (this.number == 1) {
					this.getactivityList()
				}
			} else {
				this.loadMoreText = "已没有更多数据!"
			}
		},
		/* computed:{
			var height = this.topheight 
			console.log(height)
		} */
		methods: {
			// 版本
			getBanBen() {
				this.$http.get(this.$api.isCheck).then(res => {
					if (res.code === 200) {
						if (res.msg == 1) {
							this.isCheck = false
							this.$store.commit('upIsCheck', false)
						} else {
							this.isCheck = true
							this.$store.commit('upIsCheck', true)
						}
					}
				})
			},
			// 结束时间不能大于开始时间
			computedSeveralDays(startDay, endDay) {
				let isBig = false;
				if (startDay) {
					startDay = calendar.transdate(startDay)
				}
				if (endDay) {
					endDay = calendar.transdate(endDay)
				}
				if (startDay && endDay) {
					if (endDay < startDay) {
						isBig = false
						uni.showToast({
							title: '开始时间不能大于结束时间',
							icon: 'none'
						})
					} else {
						isBig = true
					}
				} else {
					isBig = true
				}
				console.log(startDay - endDay)
				console.log(isBig)
				return isBig

				/* let endDay = calendar.transdate((this.choosedDateObj.back_full && this.choosedDateObj.back_full) || this.tomorrowDay)
				 */
			},
			// 搜索
			search(e) {
				console.log(e);
				this.searchVal = e.value
				this.pageNum = 1
				this.getlist()
			},
			//日期选择器S--
			bindDateChange: function(e) {
				let isBig = this.computedSeveralDays(e.target.value, this.date1)
				if (isBig) {
					this.date = e.target.value
				}
			},
			bindDateChange1: function(e) {
				let isBig = this.computedSeveralDays(this.date, e.target.value)
				if (isBig) {
					this.date1 = e.target.value
				}
			},
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();

				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 2;
				}
				month = month > 9 ? month : '0' + month;;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			},
			getDate1(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();

				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 2;
				}
				month = month > 9 ? month : '0' + month;;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			},
			//日期选择器E--
			//获取旅游攻略列表S--
			getlist() {
				let param = {
					articleType: this.showlylb, //游记,视频
					articleSorts: this.newlylbid, //分类s,逗号分隔
					startTime: this.date, //	开始时间
					endTime: this.date1, //		结束时间
					jqIds: this.newjingdianid, //	景区ids
					keyWords: this.searchVal, //	关键词搜索
					city: '', //		城市名
					video: '', //					视频
				}
				this.$http.post(this.$api.strategyIndex + '?pageNum=' + this.pageNum + '&pageSize=' + this.pageSize, param).then(
					res => {
						uni.stopPullDownRefresh();
						this.showLoadMore = false;
						if (res.code == 200) {
							this.last_page = res.data.pageTotal
							res.data.result.map(item => {
								if (!item.customerAvater.startsWith('http')) {
									item.customerAvater = this.$imgUrl + item.customerAvater
								}
							})
							if (this.pageNum > 1) {
								this.lygllist = this.lygllist.concat(res.data.result);
							} else {
								this.lygllist = res.data.result
							}
							if (this.searchVal) { // 如果是目的地搜索过来的，请求之后
								this.searchVal = ''
							}
							 if (uni.getStorageSync('jqId')) {
								// this.jingdianid.splice(this.jingdianid.indexOf(this.jqId), 1)
								// this.jqId = ''
								// uni.removeStorageSync('jqId');
								this.newjingdianid = ''
								uni.removeStorageSync('jqId');
							} 
						}
					})
			},
			//获取旅游攻略列表E--
			//获取活动投稿列表S--
			getactivityList() {
				let param = {
					activityCategorys: this.actnewlylbid, //	活动类别s
					activityTypes: this.actnewflid, //	活动分类 s
					activityJqIds: this.actnewjingdianid, //	景区ids
					sort: this.myid, //		1. 时间从近到远 2.阅读量从高到低
				}
				this.$http.post(this.$api.activityIndex + '?pageNum=' + this.pageNum + '&pageSize=' + this.pageSize, param).then(
					res => {
						uni.stopPullDownRefresh();
						this.showLoadMore = false;
						if (res.code == 200) {
							this.last_page = res.data.pageTotal
							if (this.pageNum > 1) {
								this.activityList = this.activityList.concat(res.data.result);
							} else {
								this.activityList = res.data.result
							}
						}
					})
			},
			//获取活动投稿列表E--
			// 各种下拉选项设置300:文章类别 301:活动攻略类别 302: 活动分类
			getDictData(type) {
				this.$http.get(this.$api.dictData + '?type=' + type).then(res => {
					if (res.code === 200) {
						if (type == 300) {
							this.lblist = res.data //这是旅游的类别
						} else if (type == 301) {
							this.activitylblist = res.data //这是活动的类别
						} else if (type == 302) {
							this.activityfllist = res.data //这是活动的分类
						}
					}
				})
			},
			//获取景点名称
			getjqNameandlist() {
				this.$http.get(this.$api.strategyjqIdNameList + '?pageNum=' + this.scpageNum + '&pageSize=' + this.scpageSize, ).then(
					res => {
						if (res.code == 200) {
							this.sclast_page = res.data.pageTotal
							if (this.scpageNum > 1) {
								this.jdlist = this.jdlist.concat(res.data.result);
							} else {
								this.jdlist = res.data.result
							}

						}
					})
			},
			// 景区下拉 触底加载
			handleScrolltolower() {
				console.log(11111111)
				if (this.scpageNum < this.sclast_page) {
					this.scpageNum++
					this.getjqNameandlist();
				}
			},
			//点击切换状态
			numType() {
				this.pageNum = 1 //清空页数
				this.showIndex = this.showlylb
				this.last_page = null
				if (this.number == 1) {
					this.number = 0
					this.number1 = 0

					this.getlist() //切换到旅游刷新
					this.hide() //切换到旅游关闭抽屉
					this.filtratePopupClose() //切换到旅游关闭弹窗
				}
			},
			numType1() {
				this.pageNum = 1 //清空页数
				this.last_page = null
				if (this.number1 == 0) {
					this.number1 = 1
					this.number = 1
					this.getactivityList() //切换到活动刷新
					this.hide() //切换到活动关闭抽屉
				}
			},
			//点击改变抽屉中标签class获取旅游投稿的类别id
			changeValue(item, index) {
				let arrIndex = this.spanIndex.indexOf(index);

				if (arrIndex > -1) {
					this.spanIndex.splice(arrIndex, 1);
				} else {
					this.spanIndex.push(index);
				}
				let idlist = this.lylbid.indexOf(item.id)
				if (idlist > -1) {
					this.lylbid.splice(idlist, 1);
				} else {
					this.lylbid.push(item.id);
				}
				this.newlylbid = this.lylbid.join(',')
			},
			changeValue1(item, index) {
				this.isActive1 = index;
			},
			//旅游的景点筛选
			changeValue2(item, index) {
				console.log(item, index)
				let arrIndex = this.jingdianIndex.indexOf(index);
				if (arrIndex > -1) {
					this.jingdianIndex.splice(arrIndex, 1);
				} else {
					this.jingdianIndex.push(index);
				}

				let idlist = this.jingdianid.indexOf(item.value)
				if (idlist > -1) {
					this.jingdianid.splice(idlist, 1);
				} else {
					this.jingdianid.push(item.value);
				}
				this.newjingdianid = this.jingdianid.join(',')
				console.log(this.newjingdianid)
			},
			//确定
			queding() {
				this.getlist()
				this.$refs.draw.close();
			},
			//显示旅游攻略抽屉
			show() {
				this.$refs.draw.open();
				this.showMsk = true
			},
			//活动投稿类别数组多选
			actchangeValue(item, index) {
				let arrIndex = this.activityspanIndex.indexOf(index);
				if (arrIndex > -1) {
					this.activityspanIndex.splice(arrIndex, 1);
				} else {
					this.activityspanIndex.push(index);
				}
				let idlist = this.actlylbid.indexOf(item.id)
				if (idlist > -1) {
					this.actlylbid.splice(idlist, 1);
				} else {
					this.actlylbid.push(item.id);
				}
				this.actnewlylbid = this.actlylbid.join(',')
			},
			//活动投稿分类数组多选
			actchangeValue1(item, index) {
				let arrIndex = this.activityflspanIndex.indexOf(index);
				if (arrIndex > -1) {
					this.activityflspanIndex.splice(arrIndex, 1);
				} else {
					this.activityflspanIndex.push(index);
				}
				let idlist = this.actflid.indexOf(item.id)
				if (idlist > -1) {
					this.actflid.splice(idlist, 1);
				} else {
					this.actflid.push(item.id);
				}
				this.actnewflid = this.actflid.join(',')
			},
			//活动投稿的景点筛选
			actchangeValue2(item, index) {
				console.log(item, index)
				let arrIndex = this.activityjdspanIndex.indexOf(index);
				if (arrIndex > -1) {
					this.activityjdspanIndex.splice(arrIndex, 1);
				} else {
					this.activityjdspanIndex.push(index);
				}

				let idlist = this.actjingdianid.indexOf(item.value)
				if (idlist > -1) {
					this.actjingdianid.splice(idlist, 1);
				} else {
					this.actjingdianid.push(item.value);
				}
				this.actnewjingdianid = this.actjingdianid.join(',')
				console.log(this.newjingdianid)
			},
			queding1() {
				this.getactivityList()
				this.$refs.tgdraw.close();
			},
			//显示活动投稿抽屉
			tougaoshow() {
				this.showIndex = 5
				this.$refs.tgdraw.open();
				this.filtratePopupClose()
				this.showMsk = true
			},
			//关闭抽屉
			hide() {
				this.spanIndex = [] //旅游类别多选数组
				this.jingdianIndex = [] //旅游景点多选数组
				this.activityspanIndex = [] //活动的类别多选数组
				this.activityflspanIndex = [] //活动的分类多选数组
				this.activityjdspanIndex = [] //活动的景点多选数组
				this.lylbid = [] //选中的旅游攻略类别id的中间量
				this.newlylbid = '' //转字符串的选中的旅游攻略类别id
				this.jingdianid = [] //选中的旅游攻略景点id的中间量
				this.newjingdianid = '' //转字符串的选中的旅游攻略景点id
				this.actlylbid = [] //选中的旅游攻略类别id的中间量
				this.actnewlylbid = '' //转字符串的选中的旅游攻略类别id
				this.actflid = [] //选中的旅游攻略类别id的中间量
				this.actnewflid = '' //选中的旅游攻略类别id的中间量
				this.actjingdianid = [] //选中的旅游攻略景点id的中间量
				this.actnewjingdianid = '' //转字符串的选中的旅游攻略景点id
				this.newjingdianid = ''

				this.date = '2020-01-01'
				let day2 = new Date();
				day2.setTime(day2.getTime());
				let s2 = day2.getFullYear() + "-" + (day2.getMonth() + 1) + "-" + day2.getDate();
				this.date1 = s2
				this.$refs.draw.close();
				this.$refs.tgdraw.close();
				this.getlist()
				this.getactivityList()
			},
			//去旅游攻略详情
			seemessage(item) {
				console.log(item)
				uni.navigateTo({
					url: '/pagesSecond/strategy/strategyMessage?id=' + item.id
				})
			},
			showChange(ind) {

				this.showIndex = ind
				this.showlylb = this.showIndex
				this.list = ''
				this.pageNum = 1
				this.last_page = null
				this.getlist()
			},
			//打开弹窗
			showChange4(ind) {
				this.showIndex = ind
				this.$refs.popup.open()
				this.$refs.tgdraw.close();
			},
			//关闭排序弹窗
			filtratePopupClose() {
				this.$refs.popup.close()
			},
			//选中的排序id
			myId(item) {
				this.myid = item.id
			},
			//确定排序弹窗
			areaSearch() {
				this.getactivityList()
				this.$refs.popup.close()
			},
			gosee(item) {
				/* var add = JSON.stringify(item)
				uni.navigateTo({
					url: '/PagesSecond/scenic/scenicDetail?item=' + add
				}) */
			},
		}
	}
</script>

<style lang="scss" scoped>
	//活动状态
	.hdtype {
		position: absolute;
		width: 88rpx;
		height: 36rpx;
		background: #FFA92D;
		opacity: 0.6;
		border-radius: 8rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 36rpx;
	}

	.overhdtype {
		position: absolute;
		width: 88rpx;
		height: 36rpx;
		background: #676767;
		opacity: 0.6;
		border-radius: 8rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 36rpx;
	}

	/* <!-- #ifdef MP-WEIXIN -->
	<view class="listone" v-if="number==0" :style="{marginTop:topheight + 294  + 'rpx'}">
		<!-- #endif -->
		<!-- #ifdef H5 --> */
	.hdtype1 {
		position: relative;
		z-index: 100;
		/* #ifdef MP-WEIXIN */
		top: 36rpx;
		/*  #endif  */
		/* #ifdef H5 */
		top: 30rpx;
		/*  #endif  */
		width: 88rpx;
		height: 36rpx;
		background: #FFA92D;
		opacity: 0.6;
		border-radius: 8rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 36rpx;
	}

	.overhdtype1 {
		position: relative;
		z-index: 100;
		/* #ifdef MP-WEIXIN */
		top: 36rpx;
		/*  #endif  */
		/* #ifdef H5 */
		top: 30rpx;
		/*  #endif  */
		width: 88rpx;
		height: 36rpx;
		background: #676767;
		opacity: 0.6;
		border-radius: 8rpx;
		font-size: 24rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 36rpx;
	}

	//悬浮窗
	.nanbar-box {
		position: fixed;
		top: 80%;
		right: 10rpx;
		width: 100rpx;
		height: 100rpx;
		background: #000000;
		opacity: 0.5;
		border-radius: 50%;
		z-index: 10;
	}

	/* /deep/ .uni-drawer__content {
		width: 600rpx;
	} */

	/* topcss S-- */
	.topbottom {
		width: 44rpx;
		height: 4rpx;
		background: #FFFFFF;
		border-radius: 2rpx;
		position: relative;
		top: 80rpx;
		left: 155rpx;
	}

	.topbottom1 {
		width: 44rpx;
		height: 4rpx;
		background: #FFFFFF;
		border-radius: 2rpx;
		position: relative;
		top: 80rpx;
		left: 400rpx;
	}

	.top-box {
		background: #2499FF;
		position: fixed;
		right: 0;
		z-index: 10000;
		width: 100%;
		background: #00B4FF;

		.topname {
			width: 100%;
			height: 108rpx;

			.topnametit {
				float: left;
				margin-left: 110rpx;
				width: 135rpx;
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: 800;
				color: #FFFFFF;
				line-height: 98rpx;
			}

			.topnametit1 {
				float: left;
				margin-left: 110rpx;
				width: 135rpx;
				height: 28rpx;
				font-size: 30rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #FFFFFF;
				line-height: 98rpx;

			}

			.shu {
				float: left;
				width: 44rpx;
				height: 4rpx;
				background: #FFFFFF;
				border-radius: 2rpx;

			}

			.avtive {
				width: 117rpx;
				height: 28rpx;
				font-size: 30rpx;
				font-weight: 500;
				color: #FFFFFF;
				line-height: 48rpx;

			}
		}

		.searchbox {
			width: 100%;
			// padding-bottom: 12rpx;
		}
	}

	.search {

		/deep/ .uni-searchbar {
			height: 56rpx;

		}

		/deep/ .uni-searchbar__cancel {
			line-height: 56rpx;
		}

		/deep/ .uni-searchbar__cancel {
			color: #fff;
		}
	}

	/deep/ .uni-searchbar {
		width: 690rpx;
		height: 56rpx;
		padding: 0 0 5rpx 20rpx !important;
		background: #00B4FF !important;
	}

	/deep/ .uni-searchbar__box {
		width: 480rpx !important;
		height: 56rpx !important;
		background: #FFFFFF !important;
	}

	/deep/ .uni-searchbar__text-placeholder {
		color: #CCCCCC !important;
	}

	.shaixuan-box {
		right: 0;
		width: 100%;
		margin-bottom: 2rpx;
		padding-left: 40rpx;
	}

	/* topcss E-- */
	/* 游玩攻略css S-- */
	.listone {
		width: 100%;
		background: #FFFFFF;
	}

	.yw {
		width: 93%;
		height: 160rpx;
		margin: 0 auto;
		padding: 20rpx 0 20rpx 0rpx;
		display: flex;
		justify-content: space-between;

		.ywleft {
			width: 220rpx;
			height: 160rpx;
			border-radius: 8rpx;
		}

		.ywright {
			width: 450rpx;
			height: 160rpx;

			.ywtx {
				width: 100%;
				height: 60rpx;
				margin: 0 0 20rpx 0;

				.ywperson {
					width: 56rpx;
					height: 56rpx;
					float: left;
					margin: 0 20rpx 0 0;
					border-radius: 50%;
				}

				.ywname {
					font-size: 24rpx;
					font-weight: 500;
					color: #333333;
				}

				.ywtittime {
					font-size: 22rpx;
					font-weight: 500;
					color: #999999;

				}
			}
		}

		.ywtit {
			font-size: 28rpx;
			font-weight: 500;
			color: #333333;
			width: 100%;
			margin-bottom: 10rpx;
		}

		.ywbiaoqian {
			width: 100%;
			height: 28rpx;

			.biaoqiantit {
				width: 350rpx;
				font-size: 24rpx;
				font-weight: 500;
				color: #00B4FF;
				float: left;
			}

			.ywsee {
				font-size: 24rpx;
				line-height: 28rpx;
				font-weight: 500;
				color: #999999;
				float: right;

				.ywseeimg {
					width: 28rpx;
					height: 24rpx;
					float: left;
					margin-top: 5rpx;
					margin-right: 10rpx;
				}
			}
		}
	}

	/* 游玩攻略css E-- */
	/* 筛选弹窗css S-- */
	.lblist {
		margin: 0 20rpx 0rpx 0;
		width: 100%;
	}

	.lblist1 {
		margin: 0 20rpx 0rpx 0;
		width: 100%;
	}

	.shaixuan {
		width: 100%;
		height: 1206rpx;
		background: #FFFFFF;

		.leibie {
			width: 100%;
			font-size: 28rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #333333;
			padding: 40rpx 0rpx 20rpx 0rpx;
		}
	}

	.lbbiaoqian {
		width: 100%;

		/* min-height: 100rpx; */
		.active {
			margin: 20rpx 20rpx 0 0;
			padding: 0 16rpx;
			display: inline-block;
			height: 48rpx;
			background: #FF4A37;
			border: 2rpx solid #FF4A37;
			text-align: center;

			.lbtit {
				font-size: 26rpx;
				font-weight: 500;
				color: #FFFFFF !important;
				line-height: 48rpx;
			}
		}

		.lbbiaoqianlist {
			margin: 20rpx 20rpx 0 0;
			padding: 0 16rpx;
			display: inline-block;
			height: 48rpx;
			border: 2rpx solid #CCCCCC;
			border-radius: 4rpx;
			text-align: center;

			.lbtit {
				font-size: 26rpx;
				font-weight: 500;
				color: #666666;
				line-height: 48rpx;
			}
		}
	}

	.quxiao {
		position: absolute;
		bottom: 20%;
		left: 30rpx;
		width: 240rpx;
		height: 80rpx;
		background: #EBEBEB;
		border-radius: 40rpx 0rpx 0rpx 40rpx;
		text-align: center;
		font-size: 32rpx;
		font-weight: 500;
		color: #666666;
		line-height: 80rpx;
	}

	.queding {
		position: absolute;
		bottom: 20%;
		right: 30rpx;
		width: 240rpx;
		height: 80rpx;
		background: #FF4A37;
		border-radius: 0 40rpx 40rpx 0;
		text-align: center;
		font-size: 32rpx;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 80rpx;


	}

	.quxiao1 {
		position: absolute;
		bottom: 20%;
		left: 34rpx;
		width: 240rpx;
		height: 80rpx;
		background: #EBEBEB;
		border-radius: 40rpx 0rpx 0rpx 40rpx;
		text-align: center;
		font-size: 32rpx;
		font-weight: 500;
		color: #666666;
		line-height: 80rpx;
	}

	.queding1 {
		position: absolute;
		bottom: 20%;
		right: 68rpx;
		width: 240rpx;
		height: 80rpx;
		background: #FF4A37;
		border-radius: 0 40rpx 40rpx 0;
		text-align: center;
		font-size: 32rpx;
		font-weight: 500;
		color: #FFFFFF;
		line-height: 80rpx;


	}

	.tp-img36 {
		margin-right: 20rpx;
	}

	/* 筛选弹窗css E-- */

	/* 投稿列表css S-- */
	.list-hang {
		margin-bottom: 2rpx;
		padding-top: 20rpx;
		padding-bottom: 20rpx;
	}

	.posimg {
		width: 24rpx;
		height: 22rpx;
	}

	.posimg1 {
		width: 24rpx;
		height: 22rpx;
	}

	.list-box {
		margin-top: 20rpx;

		.hang-img {
			width: 240rpx;
			height: 150rpx;
		}

		.hang-right {
			height: 150rpx;

			.tgaddress {
				margin-top: 30rpx;
				min-height: 64rpx;
			}
		}

		.huang-color {
			color: #999999;
		}

		/* .list-kuai:nth-child(1) {
			margin-top: 30rpx;
		}

		.list-kuai:nth-child(2) {
			margin-top: 30rpx;
		} */

		.list-kuai {
			width: 47%;
			height: 408rpx;
			margin-right: 20rpx;

			.kuai-img {
				margin: 0rpx 30rpx 0rpx 0rpx;
				width: 336rpx;
				height: 210rpx;
				border-radius: 4rpx;

			}
		}

	}

	/* 投稿列表css E-- */

	.area-bottom {
		height: 120rpx;

		.btn {
			width: 260rpx;
			height: 72rpx;
			border-radius: 36rpx;
		}
	}

	.area-bottom1 {
		height: 90rpx;

		.btn {
			width: 260rpx;
			height: 72rpx;
			border-radius: 36rpx;
		}
	}

	.area-box {
		width: 750rpx;
		background: #FFFFFF;

		.scroll-Y {
			max-height: 554rpx;
		}

		.area-left {
			width: 260rpx;

			.scroll-view-item {
				height: 88rpx;
				background: #F5F5F5;

				&.active {
					background: #FFFFFF;
					position: relative;
					color: $tc;

					&::before {
						position: absolute;
						top: 0;
						left: 0;
						content: "";
						width: 6rpx;
						height: 88rpx;
						background: #00B4FF;
					}
				}
			}
		}

		.area-right {
			.scroll-view-item {
				height: 72rpx;
				background: #FFFFFF;


				&.active {
					color: $tc;
				}
			}
		}
	}

	.price-box {
		background: #FFFFFF;

		.top {
			height: 100rpx;
			padding: 0 30rpx;
			box-sizing: border-box;

			input {
				width: 280rpx;
				height: 64rpx;
				background: rgba(245, 245, 245, 1);
				border-radius: 8rpx;
				text-align: center;
			}

		}
	}

	.tag {
		display: inline-block;
		width: 154rpx;
		height: 64rpx;
		line-height: 64rpx;
		text-align: center;
		background: #F5F5F5;
		border-radius: 8rpx;
		margin-right: 26rpx;
	}
</style>
